package com.gaussian.property.app.service;

import com.songqi.common.core.constant.Constants;
import com.songqi.common.log.domain.LoginInfoLog;
import com.songqi.common.log.domain.OperationInfoLog;
import com.songqi.common.log.service.LogApi;
import com.songqi.common.redis.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author songqi(13776346982)
 */
@Slf4j
@Service
public class LogApiImpl implements LogApi {

    @Resource
    private RedisUtils redisUtils;

    @Override
    public void saveLoginLog(LoginInfoLog loginInfoLog) {
        redisUtils.leftPushData(Constants.LOGIN_LOG_KEY, loginInfoLog);
    }

    @Override
    public void saveOperationLog(OperationInfoLog operationInfoLog) {
        redisUtils.leftPushData(Constants.OPT_LOG_KEY, operationInfoLog);
    }
}
